package com.entmanage.base.hrm.service.impl;

import java.util.List;
import com.entmanage.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.entmanage.common.utils.SecurityUtils;
import com.entmanage.base.hrm.mapper.HrmEmployeeCertificateMapper;
import com.entmanage.base.hrm.domain.HrmEmployeeCertificate;
import com.entmanage.base.hrm.service.IHrmEmployeeCertificateService;

/**
 * 员工证书子Service业务层处理
 *
 * @author lsq
 * @date 2025-09-02
 */
@Service
public class HrmEmployeeCertificateServiceImpl implements IHrmEmployeeCertificateService
{
    @Autowired
    private HrmEmployeeCertificateMapper hrmEmployeeCertificateMapper;

    /**
     * 查询员工证书子
     *
     * @param certId 员工证书子主键
     * @return 员工证书子
     */
    @Override
    public HrmEmployeeCertificate selectHrmEmployeeCertificateByCertId(Long certId)
    {
        return hrmEmployeeCertificateMapper.selectHrmEmployeeCertificateByCertId(certId);
    }

    /**
     * 查询员工证书子列表
     *
     * @param hrmEmployeeCertificate 员工证书子
     * @return 员工证书子
     */
    @Override
    public List<HrmEmployeeCertificate> selectHrmEmployeeCertificateList(HrmEmployeeCertificate hrmEmployeeCertificate)
    {
        return hrmEmployeeCertificateMapper.selectHrmEmployeeCertificateList(hrmEmployeeCertificate);
    }

    /**
     * 新增员工证书子
     *
     * @param hrmEmployeeCertificate 员工证书子
     * @return 结果
     */
    @Override
    public int insertHrmEmployeeCertificate(HrmEmployeeCertificate hrmEmployeeCertificate)
    {
        hrmEmployeeCertificate.setCreateTime(DateUtils.getNowDate());
        return hrmEmployeeCertificateMapper.insertHrmEmployeeCertificate(hrmEmployeeCertificate);
    }

    /**
     * 修改员工证书子
     *
     * @param hrmEmployeeCertificate 员工证书子
     * @return 结果
     */
    @Override
    public int updateHrmEmployeeCertificate(HrmEmployeeCertificate hrmEmployeeCertificate)
    {
        hrmEmployeeCertificate.setUpdateTime(DateUtils.getNowDate());
        return hrmEmployeeCertificateMapper.updateHrmEmployeeCertificate(hrmEmployeeCertificate);
    }

    /**
     * 批量删除员工证书子
     *
     * @param certIds 需要删除的员工证书子主键
     * @return 结果
     */
    @Override
    public int deleteHrmEmployeeCertificateByCertIds(Long[] certIds)
    {
        return hrmEmployeeCertificateMapper.deleteHrmEmployeeCertificateByCertIds(certIds);
    }

    /**
     * 删除员工证书子信息
     *
     * @param certId 员工证书子主键
     * @return 结果
     */
    @Override
    public int deleteHrmEmployeeCertificateByCertId(Long certId)
    {
        return hrmEmployeeCertificateMapper.deleteHrmEmployeeCertificateByCertId(certId);
    }

    @Override
    public List<HrmEmployeeCertificate> selectCertificateByEmpId(Long empId) {
        return hrmEmployeeCertificateMapper.selectByEmpId(empId);
    }
}
